package com.example.day01.InfoList;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.day01.R;

import java.util.ArrayList;
import java.util.List;

public class InfoListActivity extends AppCompatActivity {
    ListView listView;
    List<Info> infoList;
    private InfoAdapter infoAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_info_list);
        listView=findViewById(R.id.info_list);
        infoList=new ArrayList<>();
        Info info1=new Info("爱你","爱你",R.mipmap.ok);
        Info info2=new Info("爱你不是两三天","爱你",R.mipmap.ok);
        Info info3=new Info("狗","爱你",R.mipmap.ok);
        Info info4=new Info("熊猫","爱你",R.mipmap.ok);
        Info info5=new Info("急眼","爱你",R.mipmap.ok);
        Info info6=new Info("累","爱你",R.mipmap.ok);
        Info info7=new Info("兔子","爱你",R.mipmap.ok);
        Info info8=new Info("疑问","爱你",R.mipmap.ok);
        Info info9=new Info("笑哭","爱你",R.mipmap.ok);
        Info info10=new Info("拜拜","爱你",R.mipmap.ok);
        Info info11=new Info("橘子","爱你",R.mipmap.ok);
        Info info12=new Info("爱情","爱你",R.mipmap.ok);
        infoList.add(info1);
        infoList.add(info2);
        infoList.add(info3);
        infoList.add(info4);
        infoList.add(info5);
        infoList.add(info6);
        infoList.add(info7);
        infoList.add(info8);
        infoList.add(info9);
        infoList.add(info10);
        infoList.add(info11);
        infoList.add(info12);
        infoAdapter = new InfoAdapter(this, infoList);
        listView.setAdapter(infoAdapter);
    }
}
